# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Rémy Oudompheng <oudomphe@phare.normalesup.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>

pkgname=gmp-ecm
pkgver=7.0.5
pkgrel=1
pkgdesc='Elliptic Curve Method for Integer Factorization'
url='https://github.com/sethtroisi/gmp-ecm'
license=(GPL LGPL)
depends=(gmp)
arch=(loong64 x86_64)
source=(https://gitlab.inria.fr/zimmerma/ecm/-/archive/git-$pkgver/ecm-git-$pkgver.tar.gz)
sha256sums=('778007e9ddd914487fa6a935ba06baabfe0b38078f04ed7e102e9b52e8fa0137')

prepare() {
  cd ecm-git-$pkgver
  autoreconf -vi
}

build() {
  cd ecm-git-$pkgver
  ./configure --prefix=/usr --enable-shared --enable-openmp
  make
}

check() {
  cd ecm-git-$pkgver
  make check
}

package() {
  cd ecm-git-$pkgver
  make DESTDIR="$pkgdir" install
}
